package com.zz.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 社团信息
 * @author zhouzi
 */
@Data
@ApiModel("社团信息")
public class Club implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(type= IdType.AUTO)//主键自增
    @NotNull(message = "社团编码不能为空", groups = {Update.class})
    private Integer id;

    //社团名称
    @ApiModelProperty("社团名称")
    @NotNull(message = "社团名称不能为空")
    private String name;

    //社团图片
    @ApiModelProperty("社团图片")
    private String image;

    //社团负责人学号
    @ApiModelProperty("社团负责人学号")
    @NotNull(message = "社团负责人学号不能为空", groups = {Update.class})
    @Range(min = 1000000000, message = "负责人学号为10位", groups = {Update.class})
    private Integer leaderId;

    //联系方式
    @ApiModelProperty("联系方式")
    @NotNull(message = "联系方式不能为空", groups = {Update.class})
    @Pattern(regexp = "^[0-9]{11}",message = "手机号格式不正确", groups = {Update.class})
    private String phone;

    //指导老师
    @ApiModelProperty("指导老师")
    @NotNull(message = "指导老师不能为空", groups = {Update.class})
    private String teacher;

    //所属院系
    @ApiModelProperty("所属院系")
    @NotNull(message = "所属院系不能为空", groups = {Update.class})
    private String academy;

    //社团类别
    @ApiModelProperty("社团类别")
    @NotNull(message = "社团类别不能为空")
    private String classify;

    //社团简介
    @ApiModelProperty("社团简介")
    @NotNull(message = "社团简介不能为空", groups = {Update.class})
    private String introduce;

    @ApiModelProperty("社团人数")
    private Integer people;
}
